/*******************************************************************************
* Project: QSAR(Cute Software Architecture) 
*
* Copyright: Copyright(C) 2024 by YuetingBen, All Rights Reserved
*
* File name: PduRCfg.c
*
* Brief: ;
*
* Author: Yueting.Ben
*
* Module: PduR
*
* Generation Time: 2025-02-04 15:31:15
*
*******************************************************************************/


/** HEADER FILES **/
#include "PduRCfg.h"
#include "PduRCanTpCfg.h"
#include "PduRCanIfCfg.h"
#include "PduRDcmCfg.h"
#include "PduRComCfg.h"


/** MACRO DEFINITION **/


/** TYPEDEF DEFINITION **/
typedef struct
{
    PduR_DestPduType* destPduPtr; /* PduRDestPdu */
    PduR_SrcPduType* srcPduPtr; /* PduRSrcPdu */
    PduR_RoutingPathType* routingPathPtr; /* PduRRoutingPath */
}PduR_RoutingPathsType;


/** LOCAL DATA DEFINITION **/
const PduR_DestPduType PduR_DestPdu[PduRConf_PduHandleId_Max] = 
{
    /* pduDataProvision, destPduHandleId,                           confirmation, PduRDestPduRef  */
    {PDUR_DIRECT,        PduRComConf_PduHandleId_Tx_Channel1_Qsar_Qsar_Can4,         SET,          0x00},
    {PDUR_DIRECT,        PduRCanIfConf_PduHandleId_Tx_Channel1_Qsar_Qsar_Can4,         SET,          0x00},
    {PDUR_DIRECT,        PduRComConf_PduHandleId_Tx_Channel1_Qsar_Qsar_Can3,         SET,          0x00},
    {PDUR_DIRECT,        PduRCanIfConf_PduHandleId_Tx_Channel1_Qsar_Qsar_Can3,         SET,          0x00},
    {PDUR_DIRECT,        PduRDcmConf_PduHandleId_Tx_Channel1_Qsar_DiagPhysResponse,         SET,          0x00},
    {PDUR_DIRECT,        PduRCanTpConf_PduHandleId_Tx_Channel1_Qsar_DiagPhysResponse,         SET,          0x00},
    {PDUR_DIRECT,        PduRComConf_PduHandleId_Tx_Channel1_Qsar_Qsar_Can2,         SET,          0x00},
    {PDUR_DIRECT,        PduRCanIfConf_PduHandleId_Tx_Channel1_Qsar_Qsar_Can2,         SET,          0x00},
    {PDUR_DIRECT,        PduRComConf_PduHandleId_Tx_Channel1_Qsar_Qsar_Can1,         SET,          0x00},
    {PDUR_DIRECT,        PduRCanIfConf_PduHandleId_Tx_Channel1_Qsar_Qsar_Can1,         SET,          0x00},
    {PDUR_DIRECT,        PduRComConf_PduHandleId_Rx_Channel1_Other_Other_Can3,         SET,          0x00},
    {PDUR_DIRECT,        PduRCanIfConf_PduHandleId_Rx_Channel1_Other_Other_Can3,         SET,          0x00},
    {PDUR_DIRECT,        PduRDcmConf_PduHandleId_Rx_Channel1_Tester_DiagFuncRequest,         SET,          0x00},
    {PDUR_DIRECT,        PduRCanTpConf_PduHandleId_Rx_Channel1_Tester_DiagFuncRequest,         SET,          0x00},
    {PDUR_DIRECT,        PduRDcmConf_PduHandleId_Rx_Channel1_Tester_DiagPhysRequest,         SET,          0x00},
    {PDUR_DIRECT,        PduRCanTpConf_PduHandleId_Rx_Channel1_Tester_DiagPhysRequest,         SET,          0x00},
    {PDUR_DIRECT,        PduRComConf_PduHandleId_Rx_Channel1_Other_Other_Can2,         SET,          0x00},
    {PDUR_DIRECT,        PduRCanIfConf_PduHandleId_Rx_Channel1_Other_Other_Can2,         SET,          0x00},
    {PDUR_DIRECT,        PduRComConf_PduHandleId_Rx_Channel1_Other_Other_Can1,         SET,          0x00},
    {PDUR_DIRECT,        PduRCanIfConf_PduHandleId_Rx_Channel1_Other_Other_Can1,         SET,          0x00},
};

const PduR_SrcPduType PduR_SrcPdu[PduRConf_PduHandleId_Max] = 
{
    /* BlockSize,  SourcePduHandleId,                                SrcPduUpTxConf, PduRSrcPduRef*/
    {0x08u,        PduRConf_PduHandleId_Com_Tx_Channel1_Qsar_Qsar_Can4,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_CanIf_Tx_Channel1_Qsar_Qsar_Can4,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_Com_Tx_Channel1_Qsar_Qsar_Can3,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_CanIf_Tx_Channel1_Qsar_Qsar_Can3,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_Dcm_Tx_Channel1_Qsar_DiagPhysResponse,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_CanTp_Tx_Channel1_Qsar_DiagPhysResponse,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_Com_Tx_Channel1_Qsar_Qsar_Can2,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_CanIf_Tx_Channel1_Qsar_Qsar_Can2,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_Com_Tx_Channel1_Qsar_Qsar_Can1,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_CanIf_Tx_Channel1_Qsar_Qsar_Can1,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_Com_Rx_Channel1_Other_Other_Can3,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_CanIf_Rx_Channel1_Other_Other_Can3,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_Dcm_Rx_Channel1_Tester_DiagFuncRequest,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_CanTp_Rx_Channel1_Tester_DiagFuncRequest,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_Dcm_Rx_Channel1_Tester_DiagPhysRequest,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_CanTp_Rx_Channel1_Tester_DiagPhysRequest,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_Com_Rx_Channel1_Other_Other_Can2,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_CanIf_Rx_Channel1_Other_Other_Can2,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_Com_Rx_Channel1_Other_Other_Can1,      SET,            0x00},
    {0x08u,        PduRConf_PduHandleId_CanIf_Rx_Channel1_Other_Other_Can1,      SET,            0x00},
};


const PduR_RoutingPathType PduR_RoutingPath[PduRConf_RoutingPath_Max] = 
{
    /* PduRDestPduRRef,                                                                     PduRSrcPduRRef,                                                                          PduRQueueDepth, PduRTpThreshold, PduRDestBufferRef, RoutingMode */
    {(PduR_DestPduType*)&PduR_DestPdu[PduRConf_PduHandleId_CanIf_Tx_Channel1_Qsar_Qsar_Can4],         (PduR_SrcPduType*)&PduR_SrcPdu[PduRConf_PduHandleId_Com_Tx_Channel1_Qsar_Qsar_Can4],             0x00,           0x00,            NULL,              PDUR_ROUTINGMODE_COM_TO_CANIF},
    {(PduR_DestPduType*)&PduR_DestPdu[PduRConf_PduHandleId_CanIf_Tx_Channel1_Qsar_Qsar_Can3],         (PduR_SrcPduType*)&PduR_SrcPdu[PduRConf_PduHandleId_Com_Tx_Channel1_Qsar_Qsar_Can3],             0x00,           0x00,            NULL,              PDUR_ROUTINGMODE_COM_TO_CANIF},
    {(PduR_DestPduType*)&PduR_DestPdu[PduRConf_PduHandleId_CanTp_Tx_Channel1_Qsar_DiagPhysResponse],         (PduR_SrcPduType*)&PduR_SrcPdu[PduRConf_PduHandleId_Dcm_Tx_Channel1_Qsar_DiagPhysResponse],             0x00,           0x00,            NULL,              PDUR_ROUTINGMODE_DCM_TO_CANTP},
    {(PduR_DestPduType*)&PduR_DestPdu[PduRConf_PduHandleId_CanIf_Tx_Channel1_Qsar_Qsar_Can2],         (PduR_SrcPduType*)&PduR_SrcPdu[PduRConf_PduHandleId_Com_Tx_Channel1_Qsar_Qsar_Can2],             0x00,           0x00,            NULL,              PDUR_ROUTINGMODE_COM_TO_CANIF},
    {(PduR_DestPduType*)&PduR_DestPdu[PduRConf_PduHandleId_CanIf_Tx_Channel1_Qsar_Qsar_Can1],         (PduR_SrcPduType*)&PduR_SrcPdu[PduRConf_PduHandleId_Com_Tx_Channel1_Qsar_Qsar_Can1],             0x00,           0x00,            NULL,              PDUR_ROUTINGMODE_COM_TO_CANIF},
    {(PduR_DestPduType*)&PduR_DestPdu[PduRConf_PduHandleId_Com_Rx_Channel1_Other_Other_Can3],         (PduR_SrcPduType*)&PduR_SrcPdu[PduRConf_PduHandleId_CanIf_Rx_Channel1_Other_Other_Can3],             0x00,           0x00,            NULL,              PDUR_ROUTINGMODE_CANIF_TO_COM},
    {(PduR_DestPduType*)&PduR_DestPdu[PduRConf_PduHandleId_Dcm_Rx_Channel1_Tester_DiagFuncRequest],         (PduR_SrcPduType*)&PduR_SrcPdu[PduRConf_PduHandleId_CanTp_Rx_Channel1_Tester_DiagFuncRequest],             0x00,           0x00,            NULL,              PDUR_ROUTINGMODE_CANTP_TO_DCM},
    {(PduR_DestPduType*)&PduR_DestPdu[PduRConf_PduHandleId_Dcm_Rx_Channel1_Tester_DiagPhysRequest],         (PduR_SrcPduType*)&PduR_SrcPdu[PduRConf_PduHandleId_CanTp_Rx_Channel1_Tester_DiagPhysRequest],             0x00,           0x00,            NULL,              PDUR_ROUTINGMODE_CANTP_TO_DCM},
    {(PduR_DestPduType*)&PduR_DestPdu[PduRConf_PduHandleId_Com_Rx_Channel1_Other_Other_Can2],         (PduR_SrcPduType*)&PduR_SrcPdu[PduRConf_PduHandleId_CanIf_Rx_Channel1_Other_Other_Can2],             0x00,           0x00,            NULL,              PDUR_ROUTINGMODE_CANIF_TO_COM},
    {(PduR_DestPduType*)&PduR_DestPdu[PduRConf_PduHandleId_Com_Rx_Channel1_Other_Other_Can1],         (PduR_SrcPduType*)&PduR_SrcPdu[PduRConf_PduHandleId_CanIf_Rx_Channel1_Other_Other_Can1],             0x00,           0x00,            NULL,              PDUR_ROUTINGMODE_CANIF_TO_COM},
};

PduR_RoutingPathsType PdurRoutingPathsCfg = 
{
    (PduR_DestPduType*)PduR_DestPdu,
    (PduR_SrcPduType*)PduR_SrcPdu,
    (PduR_RoutingPathType*)PduR_RoutingPath
};


const PduR_ProviderFctIfType PduR_ProviderFctIf[PDUR_ROUTINGMODE_MAX] = 
{
    /* CANIF_TO_COM */
    {
        NULL, /* LoCancelTransmitFct */
        NULL, /* LoTransmitFct */
        NULL, /* LoTpCancelReceiveFct */
        NULL, /* LoTpCancelTransmitFct */
        NULL, /* LoTpTransmitFct */
        Com_RxIndication, /* UpRxIndicationFct */
        NULL, /* UpTriggerTransmitFct */
        NULL, /* UpTxConfirmationFct */
        NULL, /* UpTpCopyRxDataFct */
        NULL, /* UpTpCopyTxDataFct */
        NULL, /* UpTpStartOfReceptionFct */
        NULL, /* UpTpTpRxIndicationFct */
        NULL, /* UpTpTpTxConfirmationFct */
    },
    /* CANTP_TO_DCM */
    {
        NULL, /* LoCancelTransmitFct */
        NULL, /* LoTransmitFct */
        NULL, /* LoTpCancelReceiveFct */
        NULL, /* LoTpCancelTransmitFct */
        NULL, /* LoTpTransmitFct */
        NULL, /* UpRxIndicationFct */
        NULL, /* UpTriggerTransmitFct */
        NULL, /* UpTxConfirmationFct */
        Dcm_CopyRxData, /* UpTpCopyRxDataFct */
        Dcm_CopyTxData, /* UpTpCopyTxDataFct */
        Dcm_StartOfReception, /* UpTpStartOfReceptionFct */
        Dcm_TpRxIndication, /* UpTpTpRxIndicationFct */
        Dcm_TpTxConfirmation, /* UpTpTpTxConfirmationFct */
    },
    /* COM_TO_CANIF */
    {
        NULL, /* LoCancelTransmitFct */
        CanIf_Transmit, /* LoTransmitFct */
        NULL, /* LoTpCancelReceiveFct */
        NULL, /* LoTpCancelTransmitFct */
        NULL, /* LoTpTransmitFct */
        NULL, /* UpRxIndicationFct */
        NULL, /* UpTriggerTransmitFct */
        Com_TxConfirmation, /* UpTxConfirmationFct */
        NULL, /* UpTpCopyRxDataFct */
        NULL, /* UpTpCopyTxDataFct */
        NULL, /* UpTpStartOfReceptionFct */
        NULL, /* UpTpTpRxIndicationFct */
        NULL, /* UpTpTpTxConfirmationFct */
    },
    /* DCM_TO_CANTP */
    {
        NULL, /* LoCancelTransmitFct */
        CanTp_Transmit, /* LoTransmitFct */
        NULL, /* LoTpCancelReceiveFct */
        NULL, /* LoTpCancelTransmitFct */
        NULL, /* LoTpTransmitFct */
        NULL, /* UpRxIndicationFct */
        NULL, /* UpTriggerTransmitFct */
        NULL, /* UpTxConfirmationFct */
        NULL, /* UpTpCopyRxDataFct */
        NULL, /* UpTpCopyTxDataFct */
        NULL, /* UpTpStartOfReceptionFct */
        NULL, /* UpTpTpRxIndicationFct */
        NULL, /* UpTpTpTxConfirmationFct */
    }
};



